import React from 'react';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { NavBar, Icon } from 'antd-mobile';
import './IndexPage.css';

function IndexPage({dispatch,state,history}) {
  return (
    <div className='normal'>
    <NavBar leftContent="back"
      mode="dark"
      onLeftClick={() => dispatch(routerRedux.push('/list'))}
      rightContent={[
        <Icon key="0" type="search" style={{ marginRight: '0.32rem' }} />,
        <Icon key="1" type="ellipsis" />,
      ]}
    >NavBar</NavBar>
      <h1 className='title'>Yay! Welcome to dva!</h1>
      <div className='welcome'></div>
      <ul className='list'>
        <li>To get started, edit <code>src/index.js</code> and save to reload.</li>
        <li><a href="https://github.com/dvajs/dva-docs/blob/master/v1/en-us/getting-started.md">Getting Started</a></li>
      </ul>
    </div>
  );
}

IndexPage.propTypes = {
};

function mapStateToProps(state,ownProps) {
   return {
     state
   };
}

export default connect(mapStateToProps)(IndexPage);
